export function get_authorInformation(that) {
  return that.$http.get('/filing/student/info')
    .then((res) => {
      let data = res.data
      
      that.form = {
        studentName: data.student.student_name,
        birth: data.birth,
        sex: data.sex,
        nation: data.nation,
        identitycard: data.student.identitycard,
        liveAddress: data.live_address,
        homeAddress: data.home_address,
        postcode: data.postcode,
        im: data.im,
        mobile: data.mobile,
        homephone: data.homephone,
        email: data.email,
        filingStudentGuardian1: {
          elderName: data.student_guardian1 === null ? '' : data.student_guardian1.elder_name,
          nation: data.student_guardian1 === null ? '' : data.student_guardian1.nation,
          degree: data.student_guardian1 === null ? '' : data.student_guardian1.degree,
          education: data.student_guardian1 === null ? '' : data.student_guardian1.education,
          university: data.student_guardian1 === null ? '' : data.student_guardian1.university,
          professional: data.student_guardian1 === null ? '' : data.student_guardian1.professional,
          workUnit: data.student_guardian1 === null ? '' : data.student_guardian1.work_unit,
          position: data.student_guardian1 === null ? '' : data.student_guardian1.position,
          occupation: data.student_guardian1 === null ? '' : data.student_guardian1.occupation,
          title: data.student_guardian1 === null ? '' : data.student_guardian1.title,
          email: data.student_guardian1 === null ? '' : data.student_guardian1.email,
          mobile: data.student_guardian1 === null ? '' : data.student_guardian1.mobile,
        },
        filingStudentGuardian2: {
          elderName: data.student_guardian2 === null ? '' : data.student_guardian2.elder_name,
          nation: data.student_guardian2 === null ? '' : data.student_guardian2.nation,
          degree: data.student_guardian2 === null ? '' : data.student_guardian2.degree,
          education: data.student_guardian2 === null ? '' : data.student_guardian2.education,
          university: data.student_guardian2 === null ? '' : data.student_guardian2.university,
          professional: data.student_guardian2 === null ? '' : data.student_guardian2.professional,
          workUnit: data.student_guardian2 === null ? '' : data.student_guardian2.work_unit,
          position: data.student_guardian2 === null ? '' : data.student_guardian2.position,
          occupation: data.student_guardian2 === null ? '' : data.student_guardian2.occupation,
          title: data.student_guardian2 === null ? '' : data.student_guardian2.title,
          email: data.student_guardian2 === null ? '' : data.student_guardian2.email,
          mobile: data.student_guardian2 === null ? '' : data.student_guardian2.mobile,
        },
        filingStudentCharge: {
          chargeName: data.student_charge === null ? '' : data.student_charge.charge_name,
          sex: data.student_charge === null ? '' : data.student_charge.sex,
          professor: data.student_charge === null ? '' : data.student_charge.professor,
          officePhone: data.student_charge === null ? '' : data.student_charge.office_phone,
          mobile: data.student_charge === null ? '' : data.student_charge.mobile,
          email: data.student_charge === null ? '' : data.student_charge.email,
        },
        filingStudentHeadmaster: {
          headmasterName: data.student_headmaster === null ? '' : data.student_headmaster.headmaster_name,
          sex: data.student_headmaster === null ? '' : data.student_headmaster.sex,
          professor: data.student_headmaster === null ? '' : data.student_headmaster.professor,
          officePhone: data.student_headmaster === null ? '' : data.student_headmaster.office_phone,
          mobile: data.student_headmaster === null ? '' : data.student_headmaster.mobile,
          email: data.student_headmaster === null ? '' : data.student_headmaster.email
        },
        filingStudentSchool: {
          schoolName: data.student_school === null ? '' : data.student_school.school_name,
          schoolmaster: data.student_school === null ? '' : data.student_school.schoolmaster,
          schoolAddress: data.student_school === null ? '' : data.student_school.school_address,
          postcode: data.student_school === null ? '' : data.student_school.postcode,
          grade: data.student_school === null ? '' : data.student_school.grade,
          classes: data.student_school === null ? '' : data.student_school.classes,
          enrollment: data.student_school === null ? '' : data.student_school.enrollment
        }
      }
    })
}

export function get_researchProject(that) {
  return that.$http.get('/filing/project/info')
    .then((res) => {
      let data = res.data
      that.form = {
        projectTitle: data.project_title,
        projectSubtitle: data.project_subtitle,
        keyWord: data.key_word,
        subject: data.subject,
        tutor: data.tutor,
        school: data.school,
        guidanceInstitution: data.guidance_institution,
        instructExpert: data.instruct_expert,
        recommendedExperts: data.recommended_experts,
        filingProjectSubject: {
          summary: data.project_subject.summary,
          briefIntroduction: data.project_subject.brief_introduction,
          survey1: data.project_subject.survey1,
          survey2: data.project_subject.survey2,
          survey3: data.project_subject.survey3,
          survey4: data.project_subject.survey4,
          survey5: data.project_subject.survey5,
          survey6: data.project_subject.survey6,
          survey7: data.project_subject.survey7,
          dataSubmit1: data.project_subject.data_submit1,
          dataSubmit2: data.project_subject.data_submit2,
          dataSubmit3: data.project_subject.data_submit3,
          dataSubmit4: data.project_subject.data_submit4,
        }
      }
    })
}

export function get_PersonalStatement(that) {
  return that.$http.get('/filing/explain/info')
    .then((res) => {
      let data = res.data
      that.form = {
        favoriteCourses: data.favorite_courses,
        dislikeCourses: data.dislike_courses,
        middleSchoolHobby: data.middle_school_hobby,
        experienceSituation: data.experience_situation,
        vacationDoing: data.vacation_doing,
        university: data.university,
        profession: data.profession,
        occupation: data.occupation,
        longPlan: data.long_plan,
        colligateScore: '',
        filingExplainBody: {
          explainC1: data.explain_body.explain_c1,
          explainC2: data.explain_body.explain_c2,
          explainD: data.explain_body.explain_d,
          explainE: data.explain_body.explain_e,
          explainF: data.explain_body.explain_f,
          influentName: data.explain_body.influent_name,
          influentSex: data.explain_body.influent_sex,
          influentArea: data.explain_body.influent_area,
          influentProfession: data.explain_body.influent_profession,
          influentUnit: data.explain_body.influent_unit,
          influentPosition: data.explain_body.influent_position,
          influentOccupation: data.explain_body.influent_occupation,
          influentTitle: data.explain_body.influent_title,
          influentOfficephone: data.explain_body.influent_officephone,
          influentMobile: data.explain_body.influent_mobile,
          influentEmail: data.explain_body.influent_email,
          influentRelation: data.explain_body.influent_relation,
          influentDescrible: data.explain_body.influent_describle,
          careSubject: data.explain_body.care_subject,
          evaluateYourself: data.explain_body.evaluate_yourself,
          behave: data.explain_body.behave,
        }
      }
    })
}

export function get_tutor(that) {
  return that.$http.get('/filing/tutor/info')
    .then((res) => {
      if(res.data === '') return
      let data = res.data
      that.form = {
        know: data.know,
        comment: data.comment,
        tutorName: data.tutor_name,
        education: data.education,
        degree: data.degree,
        professional: data.professional,
        title: data.title,
        workUnit: data.work_unit,
        address: data.address,
        email: data.email,
        mobile: data.mobile,
        officephone: data.officephone
      }
    })
}

export function get_mentor(that) {
  return that.$http.get('/filing/mentor/info')
    .then((res) => {
      let data = res.data
      that.form = {
        question1: data.question1,
        question2: data.question2,
        question3: data.question3,
        question4: data.question4,
        mentorName: data.mentor_name,
        education: data.education,
        degree: data.degree,
        professional: data.professional,
        title: data.title,
        workUnit: data.work_unit,
        address: data.address,
        email: data.email,
        mobile: data.mobile,
        officephone: data.officephone
      }
    })
}

export function get_score(that) {
  return that.$http('/filing/score/info')
    .then(res => {
      
      let data = res.data
      if(data === '') return
      that.form = {
        classNumber: data.class_number === null ? '' : data.class_number,
        classRanking: data.class_ranking === null ? '' : data.class_ranking,
        gradeNumber: data.grade_number === null ? '' : data.grade_number,
        gradeRanking: data.grade_ranking === null ? '' : data.grade_ranking,
        graduationRates: data.graduation_rates === null ? '' : data.graduation_rates,

        schoolType1: data.school_type1 === null ? '' : data.school_type1,
        schoolType2: data.school_type2 === null ? '' : data.school_type2,

        graduationYear: data.graduation_year === null ? '' : data.graduation_year,
        graduationMonth: data.class_graduation_monthnumber === null ? '' : data.graduation_month,

        filingScoreAcademic: {
          chineseLevel: data.filing_score_academic.chinese_level === null ? '' : data.filing_score_academic.chinese_level,
          chineseHighest: data.filing_score_academic.chinese_highest === null ? '' : data.filing_score_academic.chinese_highest,
          historyLevel: data.filing_score_academic.history_level === null ? '' : data.filing_score_academic.history_level,
          historyHighest: data.filing_score_academic.history_highest === null ? '' : data.filing_score_academic.history_highest,
          mathematicsLevel: data.filing_score_academic.mathematics_level === null ? '' : data.filing_score_academic.mathematics_level,
          mathematicsHighest: data.filing_score_academic.mathematics_highest === null ? '' : data.filing_score_academic.mathematics_highest,
          politicalLevel: data.filing_score_academic.political_level === null ? '' : data.filing_score_academic.political_level,
          politicalHighest: data.filing_score_academic.political_highest === null ? '' : data.filing_score_academic.political_highest,
          englishLevel: data.filing_score_academic.english_level === null ? '' : data.filing_score_academic.english_level,
          englishHighest: data.filing_score_academic.english_highest === null ? '' : data.filing_score_academic.english_highest,
          physicalLevel: data.filing_score_academic.physical_level === null ? '' : data.filing_score_academic.physical_level,
          physicalHighest: data.filing_score_academic.physical_highest === null ? '' : data.filing_score_academic.physical_highest,
          chemistryLevel: data.filing_score_academic.chemistry_level === null ? '' : data.filing_score_academic.chemistry_level,
          chemistryHighest: data.filing_score_academic.chemistry_highest === null ? '' : data.filing_score_academic.chemistry_highest,
          artLevel: data.filing_score_academic.art_level === null ? '' : data.filing_score_academic.art_level,
          artHighest: data.filing_score_academic.art_highest === null ? '' : data.filing_score_academic.art_highest,
          musicLevel: data.filing_score_academic.music_level === null ? '' : data.filing_score_academic.music_level,
          musicHighest: data.filing_score_academic.music_highest === null ? '' : data.filing_score_academic.music_highest,
          gymLevel: data.filing_score_academic.gym_level === null ? '' : data.filing_score_academic.gym_level,
          gymHighest: data.filing_score_academic.gym_highest === null ? '' : data.filing_score_academic.gym_highest,
          informationLevel: data.filing_score_academic.information_level === null ? '' : data.filing_score_academic.information_level,
          informationHighest: data.filing_score_academic.information_highest === null ? '' : data.filing_score_academic.information_highest,
          biologyLevel: data.filing_score_academic.biology_level === null ? '' : data.filing_score_academic.biology_level,
          biologyHighest: data.filing_score_academic.biology_highest === null ? '' : data.filing_score_academic.biology_highest,
          geographyLevel: data.filing_score_academic.geography_level === null ? '' : data.filing_score_academic.geography_level,
          geographyHighest: data.filing_score_academic.geography_highest === null ? '' : data.filing_score_academic.geography_highest,
          generalLevel: data.filing_score_academic.general_level === null ? '' : data.filing_score_academic.general_level,
          generalHighest: data.filing_score_academic.general_highest === null ? '' : data.filing_score_academic.general_highest,
        },

        filingScoreFinal: [
          {
            term: 1,
            chinese: data.filing_score_final[0].chinese === null ? '' : data.filing_score_final[0].chinese,
            chineseFull:  data.filing_score_final[0].chinese_full,
            mathematics:  data.filing_score_final[0].mathematics,
            mathematicsFull:  data.filing_score_final[0].mathematics_full,
            english:  data.filing_score_final[0].english,
            englishFull:  data.filing_score_final[0].english_full,
            physical:  data.filing_score_final[0].physical,
            physicalFull:  data.filing_score_final[0].physical_full,
            chemistry:  data.filing_score_final[0].chemistry,
            chemistryFull:  data.filing_score_final[0].chemistry_full,
            biological:  data.filing_score_final[0].biological,
            biologicalFull:  data.filing_score_final[0].biological_full,
            geography:  data.filing_score_final[0].geography,
            geographyFull:  data.filing_score_final[0].geography_full,
            history:  data.filing_score_final[0].history,
            historyFull:  data.filing_score_final[0].history_full,
            political:  data.filing_score_final[0].political,
            politicalFull:  data.filing_score_final[0].political_full,
            informationTechnology:  data.filing_score_final[0].information_technology,
            informationTechnologyFull:  data.filing_score_final[0].information_technology_full,
            commonTechnology:  data.filing_score_final[0].common_technology,
            commonTechnologyFull:  data.filing_score_final[0].common_technology_full,
            classNumber:  data.filing_score_final[0].class_number,
            classRank:  data.filing_score_final[0].class_rank,
            gradeNumber:  data.filing_score_final[0].grade_number,
            gradeRank:  data.filing_score_final[0].grade_rank
          },
          {
            term: 2,
            chinese: data.filing_score_final[1].chinese,
            chineseFull: data.filing_score_final[1].chinese_full,
            mathematics: data.filing_score_final[1].mathematics,
            mathematicsFull: data.filing_score_final[1].mathematics_full,
            english: data.filing_score_final[1].english,
            englishFull: data.filing_score_final[1].english_full,
            physical: data.filing_score_final[1].physical,
            physicalFull: data.filing_score_final[1].physical_full,
            chemistry: data.filing_score_final[1].chemistry,
            chemistryFull: data.filing_score_final[1].chemistry_full,
            biological: data.filing_score_final[1].biological,
            biologicalFull: data.filing_score_final[1].biological_full,
            geography: data.filing_score_final[1].geography,
            geographyFull: data.filing_score_final[1].geography_full,
            history: data.filing_score_final[1].history,
            historyFull: data.filing_score_final[1].history_full,
            political: data.filing_score_final[1].political,
            politicalFull: data.filing_score_final[1].political_full,
            informationTechnology: data.filing_score_final[1].information_technology,
            informationTechnologyFull: data.filing_score_final[1].information_technology_full,
            commonTechnology: data.filing_score_final[1].common_technology,
            commonTechnologyFull: data.filing_score_final[1].common_technology_full,
            classNumber: data.filing_score_final[1].class_number,
            classRank: data.filing_score_final[1].class_rank,
            gradeNumber: data.filing_score_final[1].grade_number,
            gradeRank: data.filing_score_final[1].grade_rank
          },
          {
            term: 3,
            chinese: data.filing_score_final[2].chinese,
            chineseFull: data.filing_score_final[2].chinese_full,
            mathematics: data.filing_score_final[2].mathematics,
            mathematicsFull: data.filing_score_final[2].mathematics_full,
            english: data.filing_score_final[2].english,
            englishFull: data.filing_score_final[2].english_full,
            physical: data.filing_score_final[2].physical,
            physicalFull: data.filing_score_final[2].physical_full,
            chemistry: data.filing_score_final[2].chemistry,
            chemistryFull: data.filing_score_final[2].chemistry_full,
            biological: data.filing_score_final[2].biological,
            biologicalFull: data.filing_score_final[2].biological_full,
            geography: data.filing_score_final[2].geography,
            geographyFull: data.filing_score_final[2].geography_full,
            history: data.filing_score_final[2].history,
            historyFull: data.filing_score_final[2].history_full,
            political: data.filing_score_final[2].political,
            politicalFull: data.filing_score_final[2].political_full,
            informationTechnology: data.filing_score_final[2].information_technology,
            informationTechnologyFull: data.filing_score_final[2].information_technology_full,
            commonTechnology: data.filing_score_final[2].common_technology,
            commonTechnologyFull: data.filing_score_final[2].common_technology_full,
            classNumber: data.filing_score_final[2].class_number,
            classRank: data.filing_score_final[2].class_rank,
            gradeNumber: data.filing_score_final[2].grade_number,
            gradeRank: data.filing_score_final[2].grade_rank
          },
          {
            term: 4,
            chinese: data.filing_score_final[3].chinese,
            chineseFull: data.filing_score_final[3].chinese_full,
            mathematics: data.filing_score_final[3].mathematics,
            mathematicsFull: data.filing_score_final[3].mathematics_full,
            english: data.filing_score_final[3].english,
            englishFull: data.filing_score_final[3].english_full,
            physical: data.filing_score_final[3].physical,
            physicalFull: data.filing_score_final[3].physical_full,
            chemistry: data.filing_score_final[3].chemistry,
            chemistryFull: data.filing_score_final[3].chemistry_full,
            biological: data.filing_score_final[3].biological,
            biologicalFull: data.filing_score_final[3].biological_full,
            geography: data.filing_score_final[3].geography,
            geographyFull: data.filing_score_final[3].geography_full,
            history: data.filing_score_final[3].history,
            historyFull: data.filing_score_final[3].history_full,
            political: data.filing_score_final[3].political,
            politicalFull: data.filing_score_final[3].political_full,
            informationTechnology: data.filing_score_final[3].information_technology,
            informationTechnologyFull: data.filing_score_final[3].information_technology_full,
            commonTechnology: data.filing_score_final[3].common_technology,
            commonTechnologyFull: data.filing_score_final[3].common_technology_full,
            classNumber: data.filing_score_final[3].class_number,
            classRank: data.filing_score_final[3].class_rank,
            gradeNumber: data.filing_score_final[3].grade_number,
            gradeRank: data.filing_score_final[3].grade_rank
          },
          {
            term: 5,
            chinese: data.filing_score_final[4].chinese,
            chineseFull: data.filing_score_final[4].chinese_full,
            mathematics: data.filing_score_final[4].mathematics,
            mathematicsFull: data.filing_score_final[4].mathematics_full,
            english: data.filing_score_final[4].english,
            englishFull: data.filing_score_final[4].english_full,
            physical: data.filing_score_final[4].physical,
            physicalFull: data.filing_score_final[4].physical_full,
            chemistry: data.filing_score_final[4].chemistry,
            chemistryFull: data.filing_score_final[4].chemistry_full,
            biological: data.filing_score_final[4].biological,
            biologicalFull: data.filing_score_final[4].biological_full,
            geography: data.filing_score_final[4].geography,
            geographyFull: data.filing_score_final[4].geography_full,
            history: data.filing_score_final[4].history,
            historyFull: data.filing_score_final[4].history_full,
            political: data.filing_score_final[4].political,
            politicalFull: data.filing_score_final[4].political_full,
            informationTechnology: data.filing_score_final[4].information_technology,
            informationTechnologyFull: data.filing_score_final[4].information_technology_full,
            commonTechnology: data.filing_score_final[4].common_technology,
            commonTechnologyFull: data.filing_score_final[4].common_technology_full,
            classNumber: data.filing_score_final[4].class_number,
            classRank: data.filing_score_final[4].class_rank,
            gradeNumber: data.filing_score_final[4].grade_number,
            gradeRank: data.filing_score_final[4].grade_rank
          },
        ]
      }
    })
}
